package com.orange.modules.dao;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.orange.dbhelp.DbHelper;
import com.orange.modules.entity.AuthItem;
import com.orange.modules.entity.school.AuthSchoolGroupMap;

@Repository
public class AuthSchoolGroupMapRepository {

	@Autowired
	private AuthSchoolGroupMapDao authSchoolGroupMapDao;
	
	@Autowired
	private DbHelper dbHelper;
	
	/**
	 * 保存(学校与组的关系材料汇总)
	 */
	public void saveAuthSchoolGroupMap(AuthSchoolGroupMap as){
		authSchoolGroupMapDao.save(as);
	}
	/**
	 * 查询
	 * @throws SQLException 
	 */
	public AuthItem queryIsfollow(String schoolId,String groupId) throws SQLException{
		String sql = "select s_isfollow as isfollow from t_auth_school_group_map where s_school_id = ? and s_group_id = ?";
		return dbHelper.getBean(sql, AuthItem.class, schoolId, groupId);
		
	}
}
